<?php ob_start();?>
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
include($root.'/standart/head.php');
include($root.'/standart/dateHeader.php');
include($root.'/standart/checkUser.php');

if($_SERVER["REQUEST_METHOD"] == "POST"){
	$myusername=$_POST['username']; 
	$mypassword=$_POST['pass'];
	$myname=$_POST['name'];
	$mysurname=$_POST['surname'];
	$adminId = $_COOKIE["GEVEZE_ADMIN"];

	IF($myusername<>"" OR $mypassword<>"" OR $myname<>"" OR $mysurname<>"")
	{
		$stmt ="UPDATE ADMIN SET ";
		
	if ($myusername<>"") {
		$stmt =$stmt."USERNAME='$myusername', ";
	}
 	if ($mypassword<>"")
 	{
 		$stmt =$stmt."PASSWORD=MD5('$mypassword'), ";
 	}
 	if ($myname<>"")
 	{
 		$stmt =$stmt."NAME='$myname', ";
 	}
 	if ($mysurname<>"")
 	{
 		$stmt =$stmt."SURNAME='$mysurname', ";
 	}
 		$stmt = substr($stmt, 0, -2);
		$stmt = $stmt." WHERE ID=$adminId";
		$db = connect();
		$db->query($stmt) or die($stmt."<br/><br/>".mysql_error());
 		disconnect($db);
	Echo "Başarılı bir şekilde kaydedildi!";
		}
}

?>
<?php ob_end_flush(); ?>